ERL= @ERLANG@
PYTHON= @PYTHON@
APP= "urlfetch_service"

all: compile

compile:
	@mkdir -p ebin
	@(cd src;$(MAKE) ERL=$(ERL))
	@(cd pyurlfetch; $(MAKE) PYTHON=$(PYTHON))

test: compile
	@$(ERL) -pa ebin -eval "eunit:test({application,$(APP)})" \
	-noshell -s init stop

docs:
	@$(ERL) -noshell -run edoc_run application 'urlfetch' '"."' \
    '[{private, true}]'

clean-docs:
	rm -f doc/edoc-info doc/*.html doc/*.css doc/*.png

clean:
	@(cd src;$(MAKE) ERL=$(ERL) clean)

distclean: clean clean-docs
	rm -f config.log Makefile
	rm -rf bin
	rm -rf ebin
	@(cd pyurlfetch; $(MAKE) distclean)
